<div class="modal fade" id="itemFormModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px">
        <form class="form-horizontal" role="form" method="post" action="add" id="saveForm">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title">合同录入</h4>
                </div>
                <div class="modal-body clearfix">
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">合同编号</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="code" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">签约单位</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="uid" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">金额</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="amount" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">数量</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="amount" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">签约时间</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="sign_at" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">开始时间</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="start_at" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">结束时间</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="over_at" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">合同发货周期</label>
                        <div class="col-xs-8">
                            <div>
                                <input type="text" name="month" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group col-xs-6">
                        <label class="control-label col-xs-4">备注</label>
                        <div class="col-xs-8">
                            <textarea name="remark" class="form-control"></textarea>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-remove"></i> 取消</button>
                    <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $(document)
        .on('hide.bs.modal', '#itemFormModal', function(e) {
            $(this).remove();
        })
        .on('show.bs.modal', '#itemFormModal', function(e) {
            var that = $(this)
            ace.form.ajaxSub('#saveForm', function() {
                refreshTable()
                that.remove()
            })
        })
</script>
